package com.aldobucchi.ds.op
{
	import com.aldobucchi.ds.container.zet.IRSet;
	import com.aldobucchi.ds.container.zet.IWSet;

	public class SetMappingOp extends AbstractContainerMappingOp
	{
		
		
		
		private var iSet:IRSet;
		
		
		private var oSet:IWSet;

		
		
		public function SetMappingOp( iSet:IRSet, oSet:IWSet, iMappingFunction:Function=null, iCacheMappingResults:Boolean=false )
		{

			this.iSet = iSet;
			
			this.oSet = oSet;

			super( iSet, oSet, iMappingFunction, iCacheMappingResults );

			
		}
		
		

		override protected function m( e:*, m:int ):void
		{
			if ( m > 0 )
				oSet.add( e );
			if ( m < 0 )
				oSet.remove( e );

		}



		override public function dispose():void
		{
			
			super.dispose();
			
			iSet = null;
			oSet = null;
			
		}
		
		
	}
	

}